libxl: event: Move poller pipe emptying to the end of afterpoll
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 10 Jan 2020 13:19:36 +0000 (13:19 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 27 Jan 2020 16:03:18 +0000 (16:03 +0000)
commit0b70b2ff8f5a61196d090cc70040a20178327347
tree10a56b55a9a83fb77b1b956c66ae3f44f6aa01b8
parentba7a0dbb37d4f81c29baccfe69390dc35481ed6b
libxl: event: Move poller pipe emptying to the end of afterpoll

This seems neater.  It doesn't have any significant effect because:

The poller fd wouldn't be emptied by time_occurs.  It would only be
woken by time_occurs as a result of an ao completing, or by
libxl__egc_ao_cleanup_1_baton.  But ...1_baton won't be called in
between (for one thing, this would violate the rule of not still
having the active caller when ...1_baton is called).

While discussing this patch, I noticed that there is a possibility (in
libxl in general) that poller_put might be called on a woken poller.
It would probably be sensible at some point to make poller_get empty
the pipe, at least if the pipe_nonempty flag is set.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
v3: Completely revised commit message; now we think this is just
    cleanup.
tools/libxl/libxl_event.c